import moment from "moment";

export const tabs = [
    {
        label:"基本信息",
        name:"order-base-info"
    },
    {
        label:"报价信息",
        name:"price-info"
    }

]

export const fields = {
    "order-base-info" :[
        {
            vModel:"title",
            tag:"text-view",
            label:"标题",
            span:12
        },
        {
            vModel:"sn",
            tag:"text-view",
            label:"订单号",
            span:12,
        },
        {
            vModel:"snOrigin",
            tag:"text-view",
            label:"客户订单号",
            span:12,
        },
        {
            vModel:"date",
            tag:"my-date-time",
            label:"订单日期",
            span:12,
            format: "yyyy-MM-DD hh:mm:ss"
        },

        {
            vModel: "customer",
            label: "客户信息",
            span:12,
            tag:"object-view",
            labelWidth:120,
            key:'name'
        },

        {
            vModel: "contactBy",
            label: "业务人员",
            span:12,
            tag:"object-view",
            key:'name'
        },
        {
            vModel: "formBy",
            label: "制单人员",
            span:12,
            tag:"object-view",
            labelWidth:120,
            key:'name'
        },
        {
            vModel: "product",
            label: "产品名称",
            span:12,
            tag:"object-view",
            key:'name'
            // labelWidth:120,

        },
        {
            vModel: "productType",
            label: "产品类型",
            span:12,
            tag:"object-view",
            labelWidth:120,
            key:'name'
        },
        {
            vModel: "orderType",
            label: "合同类型",
            span:12,
            tag:"object-view",
            defaultValue:undefined,
            // labelWidth:120,
            key:'name'
        },
        {
            vModel:"amount",
            tag:"text-view",
            label:"数量",
            span:12,
            key:'name'
        },
        {
            vModel: "unit",
            label: "计量单位",
            span:12,
            tag:"object-view",
            key:'name'
        },
    ],
    "price-info":[
        {
            vModel: "orgMoneyType",
            label: "币种",
            span:12,
            tag:"object-view",
            key:'name'
        },
        {
            vModel: "orgPriceBefore",
            label: "原币税前单价",
            span:6,
            tag:"text-view",
        },
        {
            vModel: "orgPriceAfter",
            label: "原币税后单价",
            span:6,
            tag:"text-view",
        },
        {
            vModel: "orgTax",
            label: "原币税率",
            span:6,
            tag:"text-view"
        },
        {
            vModel: "priceBefore",
            label: "税前单价",
            span:6,
            tag:"text-view"
        },
        {
            vModel: "priceAfter",
            label: "税后单价",
            span:6,
            tag:"text-view"
        },
        {
            vModel: "tax",
            label: "税率",
            span:6,
            tag:"text-view",
        },
        {
            vModel: "taxType",
            label: "课税类型",

            span:6,
            tag:"object-view",
            key:'name'

        },
        {
            vModel: "zhangkuanguishu",
            label: "账款归属",
            span:6,
            tag:"text-view",
        },
        {
            vModel: "piaoqitianshu",
            label: "票期天数",
            span:6,
            tag:"text-view",
        },
        {
            vModel: "shoukuantianshu",
            label: "收款天数",
            span:6,
            tag:"text-view",
        },
        {
            vModel:"shoukuanriqi",
            tag:"my-date-time",
            label:"收款日期",
            span:12,
            format:"yyyy-MM-DD hh:mm:ss"
        },
        {
            vModel:"yuduiriqi",
            tag:"my-date-time",
            label:"预兑日期",
            span:12,
            format:"yyyy-MM-DD hh:mm:ss"
        },
        {
            vModel: "piaoqitiaojian",
            label: "票期条件",
            span:12,
            tag:"text-view",
        },
        {
            vModel: "shoukuantiaojian",
            label: "收款条件",
            span:12,
            tag:"text-view",
        },
    ]
}

export const deliver = {
    data: {
        url: "/admin/HtOrderDeliver/list"
    },
    columns:[
        {
            label: "订单号",
            align: "center",
            render(h,params){
                return h('span',{},params.row.order.sn)
            }
        },
        {
            prop: "amount",
            label: "数量",
            align: "center",
        },
        {
            label: "完成时间",
            align: "center",
            render:(h,params)=>{
                return h('span',{},moment(params.row.finishAt).format("YYYY-MM-DD hh:mm:ss") )
            }
        }
    ]

}
export const nodes = {
    data:{
        url: "/admin/HtOrderNote/list"
    },
    options: {
        isExpand: true
    },
    columns:[
        {
            prop: "title",
            label: "标题",
            align: "center",
        },
        {
            label: "所属订单",
            align: "center",
            render(h,params){
                return h('span',{},params.row.order.sn)
            }
        },
        {
            label: "内容",
            align: "center",
            prop:"content"
        },
        {
            prop: "files",
            label: "文件列表",
            align: "center",
            type: 'expand',
            tag: "file-upload"
        },
        {
            prop: "pics",
            label: "图片列表",
            align: "center",
            type: 'expand',
            tag: "image-upload"
        }
    ]
}
